<?php

namespace App\Http\Requests\Admin;

use Illuminate\Foundation\Http\FormRequest;

class DocumentStoreRequest extends FormRequest
{
    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        return [
            'categoryId' => 'bail|required|array',
            'categoryId.*' => 'bail|required|int',
            'print' => 'bail|nullable|int|in:0,1',
            'title' => 'bail|required|string',
            'thumb' => 'bail|required|url',
            'fileFormat' => 'bail|required|string',
            'fileSize' => 'bail|required|numeric',
            'amount' => 'bail|required|numeric',
            'file1' => 'bail|required|url',
            'file2' => 'bail|nullable|url',
            'tags' => 'bail|nullable|array',
            'previewImages' => 'bail|nullable|array',
            'previewImages.*' => 'bail|url',
            'previewPage' => 'bail|required|int',
            'totalPage' => 'bail|required|int',
            'viewCount' => 'bail|required|int',
            'downloadCount' => 'bail|required|int',
            'sort' => 'bail|required|int',
            // 'disabled' => 'bail|required|boolean',
        ];
    }
}
